# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gdk-pixbuf
pkgver=2.42.8
pkgrel=0
pkgdesc="GTK+ image loading library"
url="https://wiki.gnome.org/Projects/GdkPixbuf"
arch="all"
license="LGPL-2.0-or-later"
depends="shared-mime-info"
makedepends="tiff-dev libjpeg-turbo-dev gobject-introspection-dev
	libpng-dev glib-dev meson"
install="$pkgname.pre-deinstall"
triggers="$pkgname.trigger=/usr/lib/gdk-pixbuf-2.0/*/loaders"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-dbg"
source="https://download.gnome.org/sources/gdk-pixbuf/${pkgver%.*}/gdk-pixbuf-$pkgver.tar.xz"
replaces="gtk+"

# secfixes:
#   2.42.8-r0:
#     - CVE-2021-44648
#   2.42.2-r0:
#     - CVE-2020-29385
#   2.36.6-r1:
#     - CVE-2017-6311
#     - CVE-2017-6312
#     - CVE-2017-6314

build() {
	abuild-meson \
		-Dinstalled_tests=false \
		output .
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test -t 10 -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

doc() {
	replaces="gtk+-doc"
	default_doc
}

dev() {
	replaces="gtk+-dev"
	default_dev
}

sha512sums="
994a1374becec6235d347f4980afcc8b85f43ac373e4d7e00b7445880d0a51932e63b54429b28ab5af09e7c4437f9d6008e1c25b2d44a2c9ef7cc9821b478387  gdk-pixbuf-2.42.8.tar.xz
"
